<style type="text/css">
A:link {
	text-decoration: underline;
	color: #BCC1DD;
}

A:visited {
	text-decoration: none;
	color: #BCC1DD;
}

A:active {
	text-decoration: none
}

A:hover {
	font-size: 1200;
	font-weight: bold;
	color: #0099FF;
}
</style>


<h1>News Page</h1>

<p><?php
// Restrict posting power to only leaders or admins
$account = $this->session->userdata('account');
$access = $this->gateway_model->check_access($account);
if($access == 'leader' || $access == 'admin')
echo anchor('/news/post', ' Post News ');
?></p>


<?php

if($news_items && count($news_items) > 0){
	if (isset($archive)){
		echo heading('Archive Page' .$archive, 2);

		if ($archive != 1){
			echo anchor('/news/archives/'.($archive-1), 'Previous ');
		}
		if (!isset($end)){
			echo anchor('/news/archives/'.($archive+1), 'Next');
		}
		echo br(1);
	}
}

if(isset($news_items)){
	foreach($news_items as $item){
		?>
	
		<div class=ui-accordion-header style="overflow:hidden;"> <?php echo $item['title'];?> </div>
			
			<div class=ui-accordion-content style="overflow:hidden;">
			<p>Date: <?php echo $item['date'];?></p>
			<?php echo nl2br($item['content']);?>
			<p>Author: <?php echo $item['author'];?></p>
			<?php if ($this->gateway_model->is_admin()) echo anchor('/news/edit/' .$item['id'], 'Edit Post'); ?>
			</div>
			
		<?php 
	}		

}else{
	echo '<p>There is currently no news</p>';
}

if (!isset($archive)){
	echo anchor('/news/archives/1', 'View Archives');
} else {
	if ($archive != 1){
		echo anchor('/news/archives/'.($archive-1), 'Previous ');
	}
	if (!isset($end)){
		echo anchor('/news/archives/'.($archive+1), 'Next');
	}
}

?>



